home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / flex / flexb237.zoo / Makefile.atari < prev    next >
Makefile  |  1991-04-08  |  5KB  |  196 lines

  1. # make file for "flex" tool
  2.  
  3. # @(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/Makefile,v 2.9 90/05/26 17:28:44 vern Exp $ (LBL)
  4.  
  5. # Porting considerations:
  6. #
  7. #    For System V Unix machines, add -DUSG to CFLAGS (if it's not
  8. #         automatically defined)
  9. #    For Vax/VMS, add "-DVMS -DUSG" to CFLAGS.
  10. #    For MS-DOS, add "-DMS_DOS -DUSG" to CFLAGS.  Create \tmp if not present.
  11. #         You will also want to rename flex.skel to something with a three
  12. #         character extension, change SKELETON_FILE below appropriately,
  13. #      See MSDOS.notes for more info.
  14. #    For Amiga, add "-DAMIGA -DUSG" to CFLAGS.
  15. #    For SCO Unix, add "-DSCO_UNIX" to CFLAGS.
  16. #
  17. #    For C compilers which don't know about "void", add -Dvoid=int to CFLAGS.
  18. #
  19. #    If your C compiler is ANSI standard but does not include the <stdlib.h>
  20. #    header file (some installations of gcc have this problem), then add
  21. #    -DDONT_HAVE_STDLIB_H to CFLAGS.
  22. #
  23. # By default, flex will be configured to generate 8-bit scanners only
  24. # if the -8 flag is given.  If you want it to always generate 8-bit
  25. # scanners, add "-DDEFAULT_CSIZE=256" to CFLAGS.  Note that doing
  26. # so will double the size of all uncompressed scanners.
  27. # If on your system you have trouble building flex due to 8-bit
  28. # character problems, remove the -8 from FLEX_FLAGS and the
  29. # "#define FLEX_8_BIT_CHARS" from the beginning of flexdef.h.
  30.  
  31.  
  32. # the first time around use "make first_flex"
  33.  
  34.  
  35. # Installation targeting.  Files will be installed under the tree rooted
  36. # at DESTDIR.  User commands will be installed in BINDIR, library files
  37. # in LIBDIR (which will be created if necessary), auxiliary files in
  38. # AUXDIR, manual pages will be installed in MANDIR with extension MANEXT.
  39. # Raw, unformatted troff source will be installed if INSTALLMAN=man, nroff
  40. # preformatted versions will be installed if INSTALLMAN=cat.
  41. DESTDIR = 
  42. BINDIR = .
  43. LIBDIR = .
  44. AUXDIR = 
  45. MANDIR = .
  46. MANEXT = 1
  47. INSTALLMAN = man
  48.  
  49. # MAKE = make
  50.  
  51.  
  52. SKELETON_FILE = e:/lib/flex.skel
  53. SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_FILE)\"
  54. CFLAGS = -O
  55. LDFLAGS = -v
  56. YACC = bison -y
  57.  
  58. COMPRESSION =
  59. FLEX_FLAGS = -ist8 -Sflex.skel
  60. # which "flex" to use to generate scan.c from scan.l
  61. FLEX = ./flex
  62. CC = cgcc
  63.  
  64. AR = car
  65. RANLIB = car s
  66.  
  67. FLEXOBJS = \
  68.     ccl.o \
  69.     dfa.o \
  70.     ecs.o \
  71.     gen.o \
  72.     main.o \
  73.     misc.o \
  74.     nfa.o \
  75.     parse.o \
  76.     scan.o \
  77.     sym.o \
  78.     tblcmp.o \
  79.     yylex.o \
  80.     yyread.o
  81.  
  82. FLEX_C_SOURCES = \
  83.     ccl.c \
  84.     dfa.c \
  85.     ecs.c \
  86.     gen.c \
  87.     main.c \
  88.     misc.c \
  89.     nfa.c \
  90.     parse.c \
  91.     scan.c \
  92.     sym.c \
  93.     tblcmp.c \
  94.     yylex.c \
  95.     yyread.c
  96.  
  97. FLEX_LIB_OBJS = \
  98.     libmain.o \
  99.     yyread.o
  100.  
  101. FLEXLIB = flexlib.olb
  102.  
  103.  
  104. all : flex $(FLEXLIB)
  105.  
  106. flex : $(FLEXOBJS)
  107.     $(CC) $(CFLAGS) -o flex $(LDFLAGS) $(FLEXOBJS)
  108.  
  109. first_flex:
  110.     cp initscan.c scan.c
  111.     $(MAKE) $(MFLAGS) -f Makefile.cgcc flex
  112.  
  113. parse.h parse.c : parse.y
  114.     $(YACC) -d parse.y
  115.     mv y.tab.c parse.c
  116.     mv y.tab.h parse.h
  117.  
  118. scan.c : scan.l
  119.     $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
  120.  
  121. scan.o : scan.c parse.h flexdef.h
  122.  
  123. main.o : main.c flexdef.h
  124.     $(CC) $(CFLAGS) -c $(SKELFLAGS) main.c
  125.  
  126. ccl.o : ccl.c flexdef.h
  127. dfa.o : dfa.c flexdef.h
  128. ecs.o : ecs.c flexdef.h
  129. gen.o : gen.c flexdef.h
  130. misc.o : misc.c flexdef.h
  131. nfa.o : nfa.c flexdef.h
  132. parse.o : parse.c flexdef.h
  133. sym.o : sym.c flexdef.h
  134. tblcmp.o : tblcmp.c flexdef.h
  135. yylex.o : yylex.c flexdef.h
  136.  
  137. flex.man : flex.1
  138.     nroff -man flex.1 >flex.man
  139.  
  140. $(FLEXLIB) : $(FLEX_LIB_OBJS)
  141.     rm -f $@
  142.     $(AR) rs $(FLEXLIB) $(FLEX_LIB_OBJS)
  143.  
  144. lint : $(FLEX_C_SOURCES)
  145.     lint $(FLEX_C_SOURCES) > flex.lint
  146.  
  147. distrib :
  148.     mv scan.c initscan.c
  149.     chmod 444 initscan.c
  150.     $(MAKE) $(MFLAGS) clean
  151.  
  152. install: flex $(LIBDIR) flex.skel install.$(INSTALLMAN) install-lib
  153.     install -s -m 755 flex $(BINDIR)/flex
  154.     install -c -m 644 flex.skel $(SKELETON_FILE)
  155.  
  156. install-lib: $(LIBDIR) $(FLEXLIB)
  157.     install -c -m 644 $(FLEXLIB) $(LIBDIR)/libfl.a
  158.     $(RANLIB) $(LIBDIR)/libfl.a
  159.  
  160. $(LIBDIR):
  161.     mkdir $@
  162.  
  163. install.man: flex.1 flexdoc.1
  164.     install -c -m 644 flex.1 $(MANDIR)/flex.$(MANEXT)
  165.     install -c -m 644 flexdoc.1 $(MANDIR)/flexdoc.$(MANEXT)
  166.  
  167. install.cat: flex.1 flexdoc.1
  168.     nroff -h -man flex.1 > $(MANDIR)/flex.$(MANEXT)
  169.     nroff -h -man flexdoc.1 > $(MANDIR)/flexdoc.$(MANEXT)
  170.     chmod 644 $(MANDIR)/flex.$(MANEXT)
  171.     chmod 644 $(MANDIR)/flexdoc.$(MANEXT)
  172.  
  173. clean :
  174.     rm -f core errs flex *.o parse.c *.lint parse.h flex.man tags \
  175.         $(FLEXLIB)
  176.  
  177. tags :
  178.     ctags $(FLEX_C_SOURCES)
  179.  
  180. vms :    flex.man
  181.     $(MAKE) $(MFLAGS) distrib
  182.  
  183. test : flex
  184.     ./flex $(FLEX_FLAGS) $(COMPRESSION) scan.l | diff scan.c -
  185.  
  186. bigtest :
  187.     rm -f scan.c ; $(MAKE) COMPRESSION="-C" test
  188.     rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" test
  189.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" test
  190.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cfe" test
  191.     rm -f scan.c ; $(MAKE) COMPRESSION="-CFe" test
  192.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cf" test
  193.     rm -f scan.c ; $(MAKE) COMPRESSION="-CF" test
  194.     rm -f scan.c ; $(MAKE)
  195.